#! /bin/sh
#
#   compile - Common Lisp compile command
#

if [ ! -n "${LISP+x}" ]; then
    LISP=sbcl
fi

LISP_OPTS=

case $LISP in
    sbcl)
        LISP_OPTS="--load build.lisp --load $1.asd --eval"
        ;;
    ccl)
        LISP_OPTS="--load build.lisp --load $1.asd --eval"
        ;;
    *)
        echo "'LISP=$LISP' is not supported!"
        exit 1
        ;;
esac

$LISP $LISP_OPTS                     \
"(progn                              \
  (asdf:load-system \"$1\")          \
  (build:build-example \"$1\"))"
